package com.ranjiaqi.test;

import java.util.Arrays;

/**
 * @ClassName ArrayRevesal
 * @Description TODO
 * @Author hp
 * @Date 2021/6/21 14:01
 * @Version 1.0
 **/
public class ArrayRevesal {
    public static void main(String[] args) {
      revesal();
    }
    public static void revesal(){
        int[] arr = {1,2,3,4,5};
        int min = 0;
        int max = arr.length-1;
        while (min<max){
            arr[min]= arr[min]^arr[max];
            arr[max]= arr[min]^arr[max];
            arr[min]= arr[max]^arr[min];
            min++;
            max--;
        }

        System.out.println("arr.toString() = " + Arrays.toString(arr));
    }
}
